﻿using WebHome_API.Models;

namespace WebHome_API.Tools
{
    public class UserTool
    {
        /// <summary>
        /// 当前用户是否允许操作
        /// </summary>
        public static bool GetUserIsOK(MyContext context, int id)
        {

            var users = context.Users.FirstOrDefault(u => u.ID == id);
            if (users != null)
            {
                if (users.Gmail == null)
                {
                    return false;
                }
                else
                {
                    return true;
                }
            }
            return false;
        }
    }
}
